package com.weactivity.utils;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class ConfictedActivityStruct {

    //活动id
    private int id;

    //活动等级
    private int grade;

    //活动总人数
    private int total;

    //活动冲突人数
    private int confictedPeopleSum;

    //计数器
    private int count;

    public void countup(){
        this.count ++;
    }

    public void sumup(){
        this.confictedPeopleSum++;
    }

    //返回到场率
    public double getAttendance(){

        //这里应该再-1，去除自己本人如果能达标的话，那么就可以将用户给其他的活动
        return (double) (total-confictedPeopleSum + count -1)/total;

    };

    //判断到场率是否大于或等于80%
    //后期可以将0.8这个数据由用户自己设置
    public boolean isUpToStandard(){
        if (getAttendance() >= 0.8){
            return true;
        }
        return false;
    }


}
